package com.itrus.cert;

import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;
import org.bouncycastle.asn1.ASN1Encodable;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.ASN1Set;
import org.bouncycastle.asn1.ASN1TaggedObject;
import org.bouncycastle.asn1.DERObject;
import org.bouncycastle.asn1.DERObjectIdentifier;
import org.bouncycastle.asn1.DERSequence;
import org.bouncycastle.asn1.DERSet;
import org.bouncycastle.asn1.DERString;
import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers;
import org.bouncycastle.asn1.x509.X509DefaultEntryConverter;
import org.bouncycastle.asn1.x509.X509NameEntryConverter;
import org.bouncycastle.asn1.x509.X509NameTokenizer;

public class X509Name extends ASN1Encodable
{
  public static final DERObjectIdentifier BUSINESS_CATEGORY;
  public static final DERObjectIdentifier C = new DERObjectIdentifier("2.5.4.6");
  public static final DERObjectIdentifier CN;
  public static final DERObjectIdentifier COUNTRY_OF_CITIZENSHIP;
  public static final DERObjectIdentifier COUNTRY_OF_RESIDENCE;
  public static final DERObjectIdentifier DATE_OF_BIRTH;
  public static final DERObjectIdentifier DC;
  public static final DERObjectIdentifier DN_QUALIFIER;
  public static Hashtable DefaultLookUp;
  public static boolean DefaultReverse;
  public static Hashtable DefaultSymbols;
  public static final DERObjectIdentifier E;
  public static final DERObjectIdentifier EmailAddress;
  public static final DERObjectIdentifier GENDER;
  public static final DERObjectIdentifier GENERATION;
  public static final DERObjectIdentifier GIVENNAME;
  public static final DERObjectIdentifier INITIALS;
  public static final DERObjectIdentifier L;
  public static final DERObjectIdentifier NAME_AT_BIRTH;
  public static final DERObjectIdentifier O = new DERObjectIdentifier("2.5.4.10");
  public static Hashtable OIDLookUp;
  public static final DERObjectIdentifier OU = new DERObjectIdentifier("2.5.4.11");
  public static final DERObjectIdentifier PLACE_OF_BIRTH;
  public static final DERObjectIdentifier POSTAL_ADDRESS;
  public static final DERObjectIdentifier POSTAL_CODE;
  public static final DERObjectIdentifier PSEUDONYM;
  public static Hashtable RFC2253Symbols;
  public static final DERObjectIdentifier SERIALNUMBER;
  public static final DERObjectIdentifier SN;
  public static final DERObjectIdentifier ST;
  public static final DERObjectIdentifier STREET;
  public static final DERObjectIdentifier SURNAME;
  public static Hashtable SymbolLookUp;
  public static final DERObjectIdentifier T = new DERObjectIdentifier("2.5.4.12");
  public static final DERObjectIdentifier TELEPHONE_NUMBER;
  public static final DERObjectIdentifier UID;
  public static final DERObjectIdentifier UNIQUE_IDENTIFIER;
  public static final DERObjectIdentifier UnstructuredAddress;
  public static final DERObjectIdentifier UnstructuredName;
  private Vector added = new Vector();
  private X509NameEntryConverter converter = null;
  private Vector ordering = new Vector();
  private ASN1Sequence seq;
  private Vector values = new Vector();

  static
  {
    CN = new DERObjectIdentifier("2.5.4.3");
    SN = new DERObjectIdentifier("2.5.4.5");
    STREET = new DERObjectIdentifier("2.5.4.9");
    SERIALNUMBER = SN;
    L = new DERObjectIdentifier("2.5.4.7");
    ST = new DERObjectIdentifier("2.5.4.8");
    SURNAME = new DERObjectIdentifier("2.5.4.4");
    GIVENNAME = new DERObjectIdentifier("2.5.4.42");
    INITIALS = new DERObjectIdentifier("2.5.4.43");
    GENERATION = new DERObjectIdentifier("2.5.4.44");
    UNIQUE_IDENTIFIER = new DERObjectIdentifier("2.5.4.45");
    BUSINESS_CATEGORY = new DERObjectIdentifier("2.5.4.15");
    POSTAL_CODE = new DERObjectIdentifier("2.5.4.17");
    DN_QUALIFIER = new DERObjectIdentifier("2.5.4.46");
    PSEUDONYM = new DERObjectIdentifier("2.5.4.65");
    DATE_OF_BIRTH = new DERObjectIdentifier("1.3.6.1.5.5.7.9.1");
    PLACE_OF_BIRTH = new DERObjectIdentifier("1.3.6.1.5.5.7.9.2");
    GENDER = new DERObjectIdentifier("1.3.6.1.5.5.7.9.3");
    COUNTRY_OF_CITIZENSHIP = new DERObjectIdentifier("1.3.6.1.5.5.7.9.4");
    COUNTRY_OF_RESIDENCE = new DERObjectIdentifier("1.3.6.1.5.5.7.9.5");
    NAME_AT_BIRTH = new DERObjectIdentifier("1.3.36.8.3.14");
    POSTAL_ADDRESS = new DERObjectIdentifier("2.5.4.16");
    TELEPHONE_NUMBER = new DERObjectIdentifier("2.5.4.20");
    EmailAddress = PKCSObjectIdentifiers.pkcs_9_at_emailAddress;
    UnstructuredName = PKCSObjectIdentifiers.pkcs_9_at_unstructuredName;
    UnstructuredAddress = PKCSObjectIdentifiers.pkcs_9_at_unstructuredAddress;
    E = EmailAddress;
    DC = new DERObjectIdentifier("0.9.2342.19200300.100.1.25");
    UID = new DERObjectIdentifier("0.9.2342.19200300.100.1.1");
    OIDLookUp = new Hashtable();
    DefaultReverse = false;
    DefaultSymbols = OIDLookUp;
    RFC2253Symbols = new Hashtable();
    SymbolLookUp = new Hashtable();
    DefaultLookUp = SymbolLookUp;
    DefaultSymbols.put(C, "C");
    DefaultSymbols.put(O, "O");
    DefaultSymbols.put(T, "T");
    DefaultSymbols.put(OU, "OU");
    DefaultSymbols.put(CN, "CN");
    DefaultSymbols.put(L, "L");
    DefaultSymbols.put(ST, "S");
    DefaultSymbols.put(SN, "SERIALNUMBER");
    DefaultSymbols.put(EmailAddress, "E");
    DefaultSymbols.put(DC, "DC");
    DefaultSymbols.put(UID, "UID");
    DefaultSymbols.put(STREET, "STREET");
    DefaultSymbols.put(SURNAME, "SN");
    DefaultSymbols.put(GIVENNAME, "G");
    DefaultSymbols.put(INITIALS, "I");
    DefaultSymbols.put(GENERATION, "GENERATION");
    DefaultSymbols.put(UnstructuredAddress, "unstructuredAddress");
    DefaultSymbols.put(UnstructuredName, "unstructuredName");
    DefaultSymbols.put(UNIQUE_IDENTIFIER, "UniqueIdentifier");
    DefaultSymbols.put(DN_QUALIFIER, "dnQualifier");
    DefaultSymbols.put(PSEUDONYM, "Pseudonym");
    DefaultSymbols.put(POSTAL_ADDRESS, "PostalAddress");
    DefaultSymbols.put(NAME_AT_BIRTH, "NameAtBirth");
    DefaultSymbols.put(COUNTRY_OF_CITIZENSHIP, "CountryOfCitizenship");
    DefaultSymbols.put(COUNTRY_OF_RESIDENCE, "CountryOfResidence");
    DefaultSymbols.put(GENDER, "Gender");
    DefaultSymbols.put(PLACE_OF_BIRTH, "PlaceOfBirth");
    DefaultSymbols.put(DATE_OF_BIRTH, "DateOfBirth");
    DefaultSymbols.put(POSTAL_CODE, "PostalCode");
    DefaultSymbols.put(BUSINESS_CATEGORY, "BusinessCategory");
    DefaultSymbols.put(TELEPHONE_NUMBER, "Phone");
    RFC2253Symbols.put(C, "C");
    RFC2253Symbols.put(O, "O");
    RFC2253Symbols.put(T, "T");
    RFC2253Symbols.put(OU, "OU");
    RFC2253Symbols.put(CN, "CN");
    RFC2253Symbols.put(L, "L");
    RFC2253Symbols.put(ST, "ST");
    RFC2253Symbols.put(SN, "SN");
    RFC2253Symbols.put(EmailAddress, "EMAILADDRESS");
    RFC2253Symbols.put(DC, "DC");
    RFC2253Symbols.put(UID, "UID");
    RFC2253Symbols.put(SURNAME, "SURNAME");
    RFC2253Symbols.put(GIVENNAME, "GIVENNAME");
    RFC2253Symbols.put(INITIALS, "INITIALS");
    RFC2253Symbols.put(GENERATION, "GENERATION");
    DefaultLookUp.put("c", C);
    DefaultLookUp.put("o", O);
    DefaultLookUp.put("t", T);
    DefaultLookUp.put("ou", OU);
    DefaultLookUp.put("cn", CN);
    DefaultLookUp.put("l", L);
    DefaultLookUp.put("st", ST);
    DefaultLookUp.put("sn", SN);
    DefaultLookUp.put("emailaddress", E);
    DefaultLookUp.put("dc", DC);
    DefaultLookUp.put("e", E);
    DefaultLookUp.put("uid", UID);
    DefaultLookUp.put("surname", SURNAME);
    DefaultLookUp.put("givenname", GIVENNAME);
    DefaultLookUp.put("initials", INITIALS);
    DefaultLookUp.put("generation", GENERATION);
    DefaultLookUp.put("unstructuredaddress", UnstructuredAddress);
    DefaultLookUp.put("unstructuredname", UnstructuredName);
  }

  public X509Name(String paramString)
  {
    this(DefaultReverse, DefaultLookUp, paramString);
  }

  public X509Name(String paramString, X509NameEntryConverter paramX509NameEntryConverter)
  {
    this(DefaultReverse, DefaultLookUp, paramString, paramX509NameEntryConverter);
  }

  public X509Name(Hashtable paramHashtable)
  {
    this(null, paramHashtable);
  }

  public X509Name(Vector paramVector, Hashtable paramHashtable)
  {
    this(paramVector, paramHashtable, new X509DefaultEntryConverter());
  }

  public X509Name(Vector paramVector, Hashtable paramHashtable, X509DefaultEntryConverter paramX509DefaultEntryConverter)
  {
    this.converter = paramX509DefaultEntryConverter;
    int j;
    if (paramVector != null)
    {
      j = 0;
      if (j != paramVector.size());
    }
    label63: for (int i = 0; ; i++)
    {
      if (i == this.ordering.size())
      {
        return;
        this.ordering.addElement(paramVector.elementAt(j));
        this.added.addElement(new Boolean(false));
        j++;
        break;
        Enumeration localEnumeration = paramHashtable.keys();
        while (localEnumeration.hasMoreElements())
        {
          this.ordering.addElement(localEnumeration.nextElement());
          this.added.addElement(new Boolean(false));
        }
        break label63;
      }
      DERObjectIdentifier localDERObjectIdentifier = (DERObjectIdentifier)this.ordering.elementAt(i);
      if (paramHashtable.get(localDERObjectIdentifier) == null)
        throw new IllegalArgumentException("No attribute for object id - " + localDERObjectIdentifier.getId() + " - passed to distinguished name");
      this.values.addElement(paramHashtable.get(localDERObjectIdentifier));
    }
  }

  public X509Name(Vector paramVector1, Vector paramVector2)
  {
    this(paramVector1, paramVector2, new X509DefaultEntryConverter());
  }

  public X509Name(Vector paramVector1, Vector paramVector2, X509NameEntryConverter paramX509NameEntryConverter)
  {
    this.converter = paramX509NameEntryConverter;
    if (paramVector1.size() != paramVector2.size())
      throw new IllegalArgumentException("oids vector must be same length as values.");
    for (int i = 0; ; i++)
    {
      if (i >= paramVector1.size())
        return;
      this.ordering.addElement(paramVector1.elementAt(i));
      this.values.addElement(paramVector2.elementAt(i));
      this.added.addElement(new Boolean(false));
    }
  }

  public X509Name(ASN1Sequence paramASN1Sequence)
  {
    this.seq = paramASN1Sequence;
    Enumeration localEnumeration = paramASN1Sequence.getObjects();
    if (!localEnumeration.hasMoreElements())
      return;
    ASN1Set localASN1Set = (ASN1Set)localEnumeration.nextElement();
    int i = 0;
    label75: Vector localVector;
    if (i < localASN1Set.size())
    {
      ASN1Sequence localASN1Sequence = (ASN1Sequence)localASN1Set.getObjectAt(i);
      this.ordering.addElement(localASN1Sequence.getObjectAt(0));
      this.values.addElement(((DERString)localASN1Sequence.getObjectAt(1)).getString());
      localVector = this.added;
      if (i == 0)
        break label163;
    }
    label163: for (Boolean localBoolean = new Boolean(true); ; localBoolean = new Boolean(false))
    {
      localVector.addElement(localBoolean);
      i++;
      break label75;
      break;
    }
  }

  public X509Name(boolean paramBoolean, String paramString)
  {
    this(paramBoolean, DefaultLookUp, paramString);
  }

  public X509Name(boolean paramBoolean, String paramString, X509NameEntryConverter paramX509NameEntryConverter)
  {
    this(paramBoolean, DefaultLookUp, paramString, paramX509NameEntryConverter);
  }

  public X509Name(boolean paramBoolean, Hashtable paramHashtable, String paramString)
  {
    this(paramBoolean, paramHashtable, paramString, new X509DefaultEntryConverter());
  }

  public X509Name(boolean paramBoolean, Hashtable paramHashtable, String paramString, X509NameEntryConverter paramX509NameEntryConverter)
  {
    this.converter = paramX509NameEntryConverter;
    X509NameTokenizer localX509NameTokenizer1 = new X509NameTokenizer(paramString);
    Vector localVector1;
    Vector localVector2;
    Vector localVector3;
    if (!localX509NameTokenizer1.hasMoreTokens())
      if (paramBoolean)
      {
        localVector1 = new Vector();
        localVector2 = new Vector();
        localVector3 = new Vector();
      }
    for (int k = -1 + this.ordering.size(); ; k--)
    {
      if (k < 0)
      {
        this.ordering = localVector1;
        this.values = localVector2;
        this.added = localVector3;
        return;
        String str1 = localX509NameTokenizer1.nextToken();
        int i = str1.indexOf('=');
        if (i == -1)
          throw new IllegalArgumentException("badly formated directory string");
        String str2 = str1.substring(0, i);
        String str3 = str1.substring(i + 1);
        DERObjectIdentifier localDERObjectIdentifier = decodeOID(str2, paramHashtable);
        if (str3.indexOf('+') > 0)
        {
          X509NameTokenizer localX509NameTokenizer2 = new X509NameTokenizer(str3, '+');
          this.ordering.addElement(localDERObjectIdentifier);
          this.values.addElement(localX509NameTokenizer2.nextToken());
          this.added.addElement(new Boolean(false));
          while (localX509NameTokenizer2.hasMoreTokens())
          {
            String str4 = localX509NameTokenizer2.nextToken();
            int j = str4.indexOf('=');
            String str5 = str4.substring(0, j);
            String str6 = str4.substring(j + 1);
            this.ordering.addElement(decodeOID(str5, paramHashtable));
            this.values.addElement(str6);
            this.added.addElement(new Boolean(true));
          }
          break;
        }
        this.ordering.addElement(localDERObjectIdentifier);
        this.values.addElement(str3);
        this.added.addElement(new Boolean(false));
        break;
      }
      localVector1.addElement(this.ordering.elementAt(k));
      localVector2.addElement(this.values.elementAt(k));
      localVector3.addElement(this.added.elementAt(k));
    }
  }

  private void appendValue(StringBuffer paramStringBuffer, Hashtable paramHashtable, DERObjectIdentifier paramDERObjectIdentifier, String paramString)
  {
    String str = (String)paramHashtable.get(paramDERObjectIdentifier);
    int i;
    int j;
    label40: int m;
    label58: int i1;
    int i2;
    if (str != null)
    {
      paramStringBuffer.append(str);
      paramStringBuffer.append("=");
      i = paramString.length();
      j = 0;
      int k = ",+=\n<>#;".length();
      m = 0;
      if (j < k)
        break label193;
      if ((i > 0) && (m == 0) && ((paramString.charAt(0) == ' ') || (paramString.charAt(0) == '\n') || (paramString.charAt(i - 1) == ' ') || (paramString.charAt(i - 1) == '\n')))
        m = 1;
      if ((i > 0) && (m == 0))
      {
        i1 = 0;
        i2 = 1;
        if (i2 < i - 2)
          break label222;
      }
      label146: if (m != 0)
        paramStringBuffer.append('"');
    }
    for (int n = 0; ; n++)
    {
      if (n >= i)
      {
        if (m != 0)
          paramStringBuffer.append('"');
        return;
        paramStringBuffer.append(paramDERObjectIdentifier.getId());
        break;
        label193: if (paramString.indexOf(",+=\n<>#;".charAt(j)) == -1)
        {
          j++;
          break label40;
        }
        m = 1;
        break label58;
        label222: if ((paramString.charAt(i2) == ' ') || (paramString.charAt(i2) == '\n'))
          if (i1 != 0)
          {
            m = 1;
            break label146;
          }
        for (i1 = 1; ; i1 = 0)
        {
          i2++;
          break;
        }
      }
      char c = paramString.charAt(n);
      if ((c == '"') || (c == '\\'))
        paramStringBuffer.append('\\');
      paramStringBuffer.append(c);
    }
  }

  private DERObjectIdentifier decodeOID(String paramString, Hashtable paramHashtable)
  {
    DERObjectIdentifier localDERObjectIdentifier;
    if (paramString.toUpperCase().startsWith("OID."))
      localDERObjectIdentifier = new DERObjectIdentifier(paramString.substring(4));
    do
    {
      return localDERObjectIdentifier;
      if ((paramString.charAt(0) >= '0') && (paramString.charAt(0) <= '9'))
        return new DERObjectIdentifier(paramString);
      localDERObjectIdentifier = (DERObjectIdentifier)paramHashtable.get(paramString.toLowerCase());
    }
    while (localDERObjectIdentifier != null);
    throw new IllegalArgumentException("Unknown object id - " + paramString + " - passed to distinguished name");
  }

  public static X509Name getInstance(Object paramObject)
  {
    if ((paramObject == null) || ((paramObject instanceof X509Name)))
      return (X509Name)paramObject;
    if ((paramObject instanceof ASN1Sequence))
      return new X509Name((ASN1Sequence)paramObject);
    throw new IllegalArgumentException("unknown object in factory");
  }

  public static X509Name getInstance(ASN1TaggedObject paramASN1TaggedObject, boolean paramBoolean)
  {
    return getInstance(ASN1Sequence.getInstance(paramASN1TaggedObject, paramBoolean));
  }

  public boolean equals(Object paramObject)
  {
    if (paramObject == this)
      return true;
    if ((paramObject == null) || (!(paramObject instanceof X509Name)))
      return false;
    X509Name localX509Name = (X509Name)paramObject;
    if (getDERObject().equals(localX509Name.getDERObject()))
      return true;
    int i = this.ordering.size();
    if (i != localX509Name.ordering.size())
      return false;
    boolean[] arrayOfBoolean = new boolean[i];
    for (int j = 0; ; j++)
    {
      if (j >= i)
        return true;
      String str1 = ((DERObjectIdentifier)this.ordering.elementAt(j)).getId();
      String str2 = (String)this.values.elementAt(j);
      int k = 0;
      int m = 0;
      if (k >= i);
      while (true)
        if (m == 0)
        {
          return false;
          if (arrayOfBoolean[k] != 0);
          label136: String str3;
          String str4;
          do
          {
            k++;
            break;
            str3 = ((DERObjectIdentifier)localX509Name.ordering.elementAt(k)).getId();
            str4 = (String)localX509Name.values.elementAt(k);
          }
          while (!str1.equals(str3));
          str2 = str2.trim().toLowerCase();
          String str5 = str4.trim().toLowerCase();
          if (str2.equals(str5))
          {
            arrayOfBoolean[k] = true;
            m = 1;
          }
          else
          {
            StringBuffer localStringBuffer1 = new StringBuffer();
            StringBuffer localStringBuffer2 = new StringBuffer();
            char c3;
            int i1;
            label270: char c1;
            if (str2.length() != 0)
            {
              c3 = str2.charAt(0);
              localStringBuffer1.append(c3);
              i1 = 1;
              if (i1 < str2.length());
            }
            else if (str5.length() != 0)
            {
              c1 = str5.charAt(0);
              localStringBuffer2.append(c1);
            }
            for (int n = 1; ; n++)
            {
              if (n >= str5.length())
              {
                if (!localStringBuffer1.toString().equals(localStringBuffer2.toString()))
                  break label136;
                arrayOfBoolean[k] = true;
                m = 1;
                break;
                char c4 = str2.charAt(i1);
                if ((c3 != ' ') || (c4 != ' '))
                  localStringBuffer1.append(c4);
                c3 = c4;
                i1++;
                break label270;
              }
              char c2 = str5.charAt(n);
              if ((c1 != ' ') || (c2 != ' '))
                localStringBuffer2.append(c2);
              c1 = c2;
            }
          }
        }
    }
  }

  public boolean equals(Object paramObject, boolean paramBoolean)
  {
    if (paramObject == this)
      return true;
    if (!paramBoolean)
      return equals(paramObject);
    if ((paramObject == null) || (!(paramObject instanceof X509Name)))
      return false;
    X509Name localX509Name = (X509Name)paramObject;
    int i = this.ordering.size();
    if (i != localX509Name.ordering.size())
      return false;
    String str5;
    String str6;
    for (int j = 0; ; j++)
    {
      if (j >= i)
        return true;
      String str1 = ((DERObjectIdentifier)this.ordering.elementAt(j)).getId();
      String str2 = (String)this.values.elementAt(j);
      String str3 = ((DERObjectIdentifier)localX509Name.ordering.elementAt(j)).getId();
      String str4 = (String)localX509Name.values.elementAt(j);
      if (!str1.equals(str3))
        break label370;
      str5 = str2.trim().toLowerCase();
      str6 = str4.trim().toLowerCase();
      if (!str5.equals(str6))
        break;
    }
    StringBuffer localStringBuffer1 = new StringBuffer();
    StringBuffer localStringBuffer2 = new StringBuffer();
    char c3;
    int m;
    label223: char c1;
    if (str5.length() != 0)
    {
      c3 = str5.charAt(0);
      localStringBuffer1.append(c3);
      m = 1;
      if (m < str5.length());
    }
    else if (str6.length() != 0)
    {
      c1 = str6.charAt(0);
      localStringBuffer2.append(c1);
    }
    for (int k = 1; ; k++)
    {
      if (k >= str6.length())
      {
        if (localStringBuffer1.toString().equals(localStringBuffer2.toString()))
          break;
        return false;
        char c4 = str5.charAt(m);
        if ((c3 != ' ') || (c4 != ' '))
          localStringBuffer1.append(c4);
        c3 = c4;
        m++;
        break label223;
      }
      char c2 = str6.charAt(k);
      if ((c1 != ' ') || (c2 != ' '))
        localStringBuffer2.append(c2);
      c1 = c2;
    }
    label370: return false;
  }

  public Vector getOIDs()
  {
    Vector localVector = new Vector();
    for (int i = 0; ; i++)
    {
      if (i == this.ordering.size())
        return localVector;
      localVector.addElement(this.ordering.elementAt(i));
    }
  }

  public Vector getValues()
  {
    Vector localVector = new Vector();
    for (int i = 0; ; i++)
    {
      if (i == this.values.size())
        return localVector;
      localVector.addElement(this.values.elementAt(i));
    }
  }

  public int hashCode()
  {
    Enumeration localEnumeration = ((ASN1Sequence)getDERObject()).getObjects();
    int i = 0;
    while (true)
    {
      if (!localEnumeration.hasMoreElements())
        return i;
      i ^= localEnumeration.nextElement().hashCode();
    }
  }

  public DERObject toASN1Object()
  {
    ASN1EncodableVector localASN1EncodableVector1;
    ASN1EncodableVector localASN1EncodableVector2;
    Object localObject;
    int i;
    if (this.seq == null)
    {
      localASN1EncodableVector1 = new ASN1EncodableVector();
      localASN1EncodableVector2 = new ASN1EncodableVector();
      localObject = null;
      i = 0;
      if (i == this.ordering.size())
      {
        localASN1EncodableVector1.add(new DERSet(localASN1EncodableVector2));
        this.seq = new DERSequence(localASN1EncodableVector1);
      }
    }
    else
    {
      return this.seq;
    }
    ASN1EncodableVector localASN1EncodableVector3 = new ASN1EncodableVector();
    DERObjectIdentifier localDERObjectIdentifier = (DERObjectIdentifier)this.ordering.elementAt(i);
    localASN1EncodableVector3.add(localDERObjectIdentifier);
    String str = (String)this.values.elementAt(i);
    localASN1EncodableVector3.add(this.converter.getConvertedValue(localDERObjectIdentifier, str));
    if ((localObject == null) || (((Boolean)this.added.elementAt(i)).booleanValue()))
      localASN1EncodableVector2.add(new DERSequence(localASN1EncodableVector3));
    while (true)
    {
      localObject = localDERObjectIdentifier;
      i++;
      break;
      localASN1EncodableVector1.add(new DERSet(localASN1EncodableVector2));
      localASN1EncodableVector2 = new ASN1EncodableVector();
      localASN1EncodableVector2.add(new DERSequence(localASN1EncodableVector3));
    }
  }

  public String toString()
  {
    return toString(DefaultReverse, DefaultSymbols);
  }

  public String toString(boolean paramBoolean, Hashtable paramHashtable)
  {
    StringBuffer localStringBuffer = new StringBuffer();
    int i = 1;
    if (paramBoolean)
    {
      int k = -1 + this.ordering.size();
      if (k < 0)
        return localStringBuffer.toString();
      if (i != 0)
        i = 0;
      while (true)
      {
        appendValue(localStringBuffer, paramHashtable, (DERObjectIdentifier)this.ordering.elementAt(k), (String)this.values.elementAt(k));
        k--;
        break;
        if (((Boolean)this.added.elementAt(k + 1)).booleanValue())
          localStringBuffer.append("+");
        else
          localStringBuffer.append(", ");
      }
    }
    int j = 0;
    label125: if (j < this.ordering.size())
    {
      if (i == 0)
        break label181;
      i = 0;
    }
    while (true)
    {
      appendValue(localStringBuffer, paramHashtable, (DERObjectIdentifier)this.ordering.elementAt(j), (String)this.values.elementAt(j));
      j++;
      break label125;
      break;
      label181: if (((Boolean)this.added.elementAt(j)).booleanValue())
        localStringBuffer.append("+");
      else
        localStringBuffer.append(", ");
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.itrus.cert.X509Name
 * JD-Core Version:    0.6.2
 */